package com.sgj.gulimall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sgj.common.utils.PageUtils;
import com.sgj.common.vo.MemberRegistVo;
import com.sgj.common.vo.SocialUser;
import com.sgj.common.vo.UserLoginVo;
import com.sgj.gulimall.member.entity.MemberEntity;
import com.sgj.gulimall.member.exception.PhoneExistException;
import com.sgj.gulimall.member.exception.UserNameExistException;

import java.util.Map;

/**
 * 会员
 *
 * @author guojishen
 * @email 1261550408@qq.com
 * @date 2021-06-15 09:06:47
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 社交登陆
     * @param socialUser
     * @return
     */
    MemberEntity oAuthLogin(SocialUser socialUser) throws Exception;

    /**
     * 登陆
     * @param vo
     * @return
     */
    MemberEntity login(UserLoginVo vo);

    /**
     * 用户注册
     * @param vo
     */
    void register(MemberRegistVo vo);

    /**
     * 校验用户名是否唯一
     * @param userName
     * @return
     */
    void checkUserNameUnique(String userName) throws UserNameExistException;

    /**
     * 校验手机号是否唯一
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws PhoneExistException;
}

